package com.shop2cn.iapi.sqpayment.testcase;

import java.math.BigDecimal;
import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.sqpayment.parameter.AcquireOrderBean;
import com.shop2cn.iapi.sqpayment.parameter.AcquireRefundBean;
import com.shop2cn.iapi.sqpayment.service.AcquireRefundCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymt.utils.tag.P3;
import com.ymttest.business.service.SQPayGateWayCallService;
import com.ymttest.database.model.MPayment;
import com.ymttest.database.model.MRefund;
import com.ymttest.database.sqlwapper.SQPayGateWayWapper;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;

/**
 * 部分退款接口 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_AcquireRefund {
	private static AcquireRefundBean acquirerefundBean;
	private static AcquireRefundCall acquirerefundCall;
	private static  SQPayGateWayWapper paymentwapper;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("部分退款接口");
	}

	@Before
	public void caseUp() {
		acquirerefundBean = new AcquireRefundBean();
		acquirerefundCall = new AcquireRefundCall();
		paymentwapper=new SQPayGateWayWapper();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(acquirerefundCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_001() {
		Logger.start(true, "输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_AcquireRefund_002() {
		Logger.start(true, "输入部分退款金额,收单成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
//			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_AcquireRefund_003() {
		Logger.start(true, "多次退款,输入部分退款金额总和不超过总金额,收单成功");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
//			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(1);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			
			//这里做一次退款执行
			MPayment ppm = paymentwapper.selectPaymentByTradingid(aqb.getOrderId()).get(0);
			String trandno = ppm.getPaymentId();
			List<MRefund> mlist = paymentwapper.selectRefundRequestByPaymentId(trandno);
			SQPayGateWayCallService.executeRefund(mlist.get(0), "10");
			acquirerefundBean.setTradeType(1);
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundCall.callService();
			//主键不能重复导致，更新数据库后应该可以成功
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_AcquireRefund_004() {
		Logger.start(true, "单次输入退款金额超过总金额,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(1+aqb.getPayPrice());
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("3501", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("拒绝退款", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
			Logger.verifyEquals("false", acquirerefundCall.getString("IsSuccess"), "验证IsSuccess");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_AcquireRefund_005() {
		Logger.start(true, "多次退款,输入部分退款金额总和超过总金额,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
//			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(1);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			acquirerefundBean.setRefundAmt("7");
			acquirerefundBean.setTradeType(1);
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundCall.callService();
			Logger.verifyEquals("3501", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("拒绝退款", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
			Logger.verifyEquals("false", acquirerefundCall.getString("IsSuccess"), "验证IsSuccess");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_006() {
		Logger.start(true, "不输入必填项AppId,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
//			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
//			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("appId not be empty", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_007() {
		Logger.start(true, "不输入必填项OrderId,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
//			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
//			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("orderId not be empty", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_008() {
		Logger.start(true, "不输入必填项TradeNo,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
//			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("tradeNo not be empty", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_009() {
		Logger.start(true, "不输入必填项RefundNo,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("1");
//			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("refundNo not be empty", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_010() {
		Logger.start(true, "不输入必填项RefundAmt,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("refundAmt not valid", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_011() {
		Logger.start(true, "不输入必填项TradeType,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
//			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("must be greater than or equal to 1", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_012() {
		Logger.start(true, "输入不存在TradeNo,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo("-1");
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			//??
			Logger.verifyEquals("3501", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("拒绝退款", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_013() {
		Logger.start(true, "输入错误RefundAmt0,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("0");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("参数异常|RefundAmt should be greater than 0.", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_014() {
		Logger.start(true, "输入错误RefundAmt-1,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("-1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("参数异常|RefundAmt should be greater than 0.", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_AcquireRefund_015() {
		Logger.start(true, "输入错误TradeType-1,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(-1);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("must be greater than or equal to 1", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_AcquireRefund_016() {
		Logger.start(true, "未支付的订单部分退款,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(1);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("3501", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("拒绝退款", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_AcquireRefund_017() {
		Logger.start(true, "重复提交部分退款金额,金额超过总额一半,返回成功(幂等)");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			aqb.setPayPrice("5");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("3");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(1);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_018() {
		Logger.start(true, "招行输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("50");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_019() {
		Logger.start(true, "招行优惠后输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("50");
			aqb.setPayPrice("5");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall50(aqb,"1");
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("4");
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	@Ignore
	//20181025招行优惠功能不兼容微信立减版本
	public void Tc_AcquireRefund_020() {
		Logger.start(true, "招行优惠后输入优惠前退款金额,失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("50");
			aqb.setPayPrice("5");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall50(aqb,"1");
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("3501", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("false", acquirerefundCall.getString("IsSuccess"), "验证IsSuccess");
			Logger.verifyEquals("拒绝退款", acquirerefundCall.getString("ErrorMessage"), "验证ErrorMessage");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_021() {
		Logger.start(true, "输入全部退款金额,带上字段bizNo,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setBizNo(TestDataManager.getRandomUUID().toString());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_022() {
		Logger.start(true, "applepay输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("60");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_023() {
		Logger.start(true, "baofu输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("70");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_024() {
		Logger.start(true, "applepay输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("60");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_025() {
		Logger.start(true, "9.支付宝花呗输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("9");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_026() {
		Logger.start(true, "17微信app小程序输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("17");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_027() {
		Logger.start(false, "支付超过90天退款失败");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("10");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			String pid=paymentwapper.selectPaymentByTradingid(aqb.getOrderId()).get(0).getPaymentId();
			paymentwapper.updatePayTimeByPid(pid, YMTDateUtil.getBeforeOrNextDay(-91));
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("3501", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			Logger.verifyEquals("false", acquirerefundCall.getString("IsSuccess"), "验证IsSuccess");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_028() {
		Logger.start(true, "18直播微店输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("18");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_029() {
		Logger.start(true, "19海外直播扫货微信APP支付输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("19");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_030() {
		Logger.start(true, "80翼支付输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("80");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_031() {
		Logger.start(true, "62.upay-app输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("62");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_032() {
		Logger.start(true, "63.upay-wap输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("63");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_033() {
		Logger.start(true, "3017分销-微信全球购输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3017");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_034() {
		Logger.start(true, "64.小米支付输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("64");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_035() {
		Logger.start(true, "3013.全球优选-支付宝App输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3013");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_036() {
		Logger.start(true, "3015.全球优选-微信App输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3015");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_037() {
		Logger.start(true, "65.HuaweiPay输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("65");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_038() {
		Logger.start(true, "66.SamSungPay输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("66");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_039() {
		Logger.start(true, "6000.HipoPayWxApp输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6000");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_040() {
		//这个渠道测试环境用的是洋码头
		Logger.start(true, "8.支付宝花呗输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("8");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_041() {
		Logger.start(true, "6000.HipoPayWxApp输入退款金额JPY带小数点,拦截");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6000");
			aqb.setPriceCurrency("JPY");
			aqb.setSettleCurrency("JPY");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("0.5");
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_042() {
		Logger.start(true, "6001.HipoPayWxH5输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6001");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_043() {
		Logger.start(true, "6001.HipoPayWxH5输入退款金额JPY带小数点,拦截");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6001");
			aqb.setPriceCurrency("JPY");
			aqb.setSettleCurrency("JPY");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("0.5");
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("1000", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_044() {
		Logger.start(true, "90分期乐输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("90");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_045() {
		Logger.start(true, "3113.全球优选-支付宝App输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3113");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_046() {
		Logger.start(true, "3115.全球优选-微信App输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3115");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_047() {
		Logger.start(true, "3117分销-微信全球购输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3117");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_048() {
		Logger.start(true, "3213.鱼多多全球优选-支付宝App输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3213");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_049() {
		Logger.start(true, "3215.鱼多多全球优选-微信App输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("3215");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_050() {
		Logger.start(true, "2013.抖音支付宝输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("2013");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_051() {
		Logger.start(true, "91分期乐小程序输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("91");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_052() {
		Logger.start(true, "6002.HipoPayWxH5输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6002");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_053() {
		Logger.start(true, "6010盛付通微信小程序输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6010");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_054() {
		Logger.start(true, "6011盛付通微信公众号输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6011");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_055() {
		Logger.start(true, "6010盛付通渠道支持部分退款");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6010");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt("1.00");
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_056() {
		Logger.start(true, "6006代购神器HipoPayAliWap输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6006");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_057() {
		Logger.start(true, "6100GodAliPayPc输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6100");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	private void verifyDB(AcquireOrderBean aqb, AcquireRefundBean arb) throws Exception {
		Logger.comment("验证数据库RefundRequest");
		MPayment ppm = paymentwapper.selectPaymentByTradingid(aqb.getOrderId()).get(0);
		String trandno = ppm.getPaymentId();
		List<MRefund> mlist = paymentwapper.selectRefundRequestByPaymentId(trandno);
		// 这里实际只会查出一条记录 trandno没有重复？
		for (int i = 0; i < mlist.size(); i++) {
			MRefund m = mlist.get(i);
			Logger.debug(m);
			if (m.getOrderId().toString().equals(arb.getOrderId())) {
				Logger.debug("selectRefundRequestByPaymentId:" + m);
				Logger.verifyEquals(0, m.getRefundStatus(), "验证RefundStatus");
				Logger.verifyEquals(0, m.getApproveStatus(), "验证ApproveStatus");
//				Logger.verifyEquals(ppm.getInstitutionPaymentId(), m.getInstPaymentId(), "验证InstPaymentId");
//				Logger.verifyEquals(arb.getAppId(), m.getAppId(), "验证AppId");
//				Logger.verifyEquals(aqb.getCurrency(), m.getCurrencyType(), "验证CurrencyType");
				Logger.verifyEquals(arb.getOrderId(), m.getOrderId().toString(), "验证OrderId");
				// Logger.verifyEquals(srbean.getTraceId(), m.get("TraceId"),
				// "验证TraceId");
//				Logger.verifyEquals(arb.getTradeType().toString(), m.getTradeType().toString(), "验证TradeType");
//				Logger.verifyEquals(arb.getTradeNo(), m.getTradeNo(), "验证TradeNo");
				Logger.verifyEquals(new BigDecimal(arb.getRefundAmt()).setScale(2), m.getRefundAmt().setScale(2), "验证RefundAmount");
				Logger.verifyNotNull(m.getRefundId(), "验证RefundId非空");
				if(arb.getBizNo()!=null){
					Logger.verifyEquals(arb.getBizNo(),m.getBizNo(),"验证bizno");
				}
			}
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_058() {
		Logger.start(true, "6103.HipoPay-微信app输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6103");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_059() {
		Logger.start(true, "6107.HipoPay-支付宝app输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6107");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_060() {
		Logger.start(true, "6003.HipoPayWxH5输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6003");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_061() {
		Logger.start(true, "4013输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("4013");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_062() {
		Logger.start(true, "4016输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("4016");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_063() {
		Logger.start(true, "6012盛付通支付宝输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6012");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_AcquireRefund_064() {
		Logger.start(true, "6207输入全部退款金额,收单成功,生成RefundBatchNos");
		try {
			AcquireOrderBean aqb = SQPayGateWayCallService.initAcquireOrder("6207");
			SQPayGateWayCallService.acquireOrder(aqb);
			SQPayGateWayCallService.notifyCall(aqb);
			acquirerefundBean.setAppId("AutoTest");
			acquirerefundBean.setOrderId(TestDataManager.getClientpaymentId());
			acquirerefundBean.setRefundAmt(aqb.getPayPrice());
//			acquirerefundBean.setRefundAmt("1");
			acquirerefundBean.setRefundNo(TestDataManager.getClientpaymentId());
			acquirerefundBean.setTradeNo(aqb.getOrderId());
			acquirerefundBean.setTradeType(2);
			acquirerefundCall.setData(acquirerefundBean);
			acquirerefundCall.callService();
			Logger.verifyEquals("0", acquirerefundCall.getString("ErrorCode"), "验证ErrorCode");
			verifyDB(aqb, acquirerefundBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}